<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// 项目 目录 Home
Route::group(['namespace'=>'Home'],function(){


    Route::group(['middleware'=>['AuthHome:admin']],function(){
        Route::get('/',"IndexController@index");
        // admin 前缀
        require(__DIR__.'/Home/Admin.php');
        // role  前缀
        require(__DIR__.'/Home/Role.php');
        // permission 前缀
        require(__DIR__.'/Home/Permission.php');
        // menu 前缀
        require(__DIR__.'/Home/Menu.php');
    });
//    // 登陆页面 前缀为 Login
    Route::group(['prefix'=>'login'],function(){
        Route::get('/','LoginController@index');
        Route::post('/','LoginController@login');
        Route::get('/logout','LoginController@logout');// 退出登陆
    });


   require(__DIR__.'/Home/Init.php');
});